package com.itzg.svn;


public class SvnOpRecording {
	private static final int NANOS_PER_MILLI = 1000000;
	private SvnOp op;
	private SvnPlace place;
	private long timestamp;
	private long durationNanos;
	private long revision;
	private String info;
	public SvnOpRecording(SvnOp op, SvnPlace place, long startingTimestampNanos,
			long endingTimestampNanos, long revision, String info) {
		super();
		this.op = op;
		this.place = place;
		this.timestamp = System.currentTimeMillis();
		this.durationNanos = endingTimestampNanos - startingTimestampNanos;
		this.revision = revision;
		this.info = info;
	}
	@Override
	public String toString() {
		return String.format("%tT %-10s %-6s r%-6d %dms %s", timestamp, op, place, revision, durationNanos/NANOS_PER_MILLI, info);
	}
	public SvnOp getOp() {
		return op;
	}
	public SvnPlace getPlace() {
		return place;
	}
	public long getTimestamp() {
		return timestamp;
	}
	public long getDurationNanos() {
		return durationNanos;
	}
	public long getRevision() {
		return revision;
	}
	public String getInfo() {
		return info;
	}
}
